local skel = fk.CreateSkill {
  name = "efengqi__zhaxiang",
}

Fk:loadTranslationTable{
  ["efengqi__zhaxiang"] = "诈降",
  [":efengqi__zhaxiang"] = "出牌阶段限一次，你可以令一名角色摸一张牌，然后视为对其使用一张【火攻】，若你因此受到伤害，重置此技能。",
  ["#efengqi__zhaxiang"] = "诈降：令一名角色摸一张牌，视为对其使用【火攻】",

  ["$efengqi__zhaxiang1"] = "铁锁连舟而行，东吴水师可破！",
  ["$efengqi__zhaxiang2"] = "两军阵前，不斩降将！",
}

skel:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "#efengqi__zhaxiang",
  card_filter = Util.FalseFunc,
  target_filter = function (self, player, to_select, selected)
    return #selected == 0
  end,
  times = function (self, player)
    return 1 - player:usedSkillTimes(self.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local to = effect.tos[1]
    to:drawCards(1, self.name)
    if to.dead or player.dead or to:isKongcheng() then return end
    local use = room:useVirtualCard("fire_attack", nil, player, to, self.name)
    if use and use.damageDealt and use.damageDealt[player] then
      player:setSkillUseHistory(self.name, 0, Player.HistoryPhase)
    end
  end,
})

return skel
